package cn.tedu.weibo.controller;

import cn.tedu.weibo.common.response.JsonResult;
import cn.tedu.weibo.pojo.vo.WeiboIndexVO;
import cn.tedu.weibo.service.IWeiboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/weibos/")
public class WeiboController {
    @Autowired
    IWeiboService weiboService;
    @GetMapping("")
    public JsonResult list(){

        List<WeiboIndexVO> list = weiboService.list();
        return JsonResult.ok(list);
    }

}
